<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '福利中心',
    navigationStyle: 'custom',
  },
}
</route>
<template>
  <view class="game-hall">
    <image src="/static/images/welfare/welfareBg.png" class="welfare-bg" />
    <!-- 每日签到标题 -->
    <view class="sign-title">
      <image src="/static/images/welfare/sign.png" mode="aspectFit" class="sign-title-image" />
    </view>

    <!-- 签到列表 -->
    <view class="sign-container">
      <view
        class="sign-item"
        v-for="(day, index) in signDays"
        :key="index"
        :class="{ 'sign-item-day7': index === 6 }"
      >
        <view class="sign-item-content">
          <view class="day-number">第{{ index + 1 }}天</view>
          <view class="item-count" v-if="index === 6">
            <text>{{ day.count }}个</text>
          </view>
        </view>
        <view class="sign-reward">
          <image
            :src="
              index === 6 ? '/static/images/rank/redBang.png' : '/static/images/rank/blueBang.png'
            "
            mode="aspectFit"
            class="crystal-image"
          ></image>
          <view class="item-count" v-if="index !== 6">
            <text>{{ day.count }}个</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 底部导航栏 -->
    <Tabbar ref="Tabbar" pagePath="/pages/welfare/index" />
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import Tabbar from '@/components/tabbar/tabbar.vue'

// 签到天数数据
const signDays = ref([
  { count: 38 },
  { count: 38 },
  { count: 38 },
  { count: 38 },
  { count: 38 },
  { count: 38 },
  { count: 10 },
])
</script>

<style lang="scss">
.game-hall {
  min-height: 100vh;
  background-image: url('/static/images/login/loginBackground.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  color: #ffffff;
  padding: 20rpx;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  .welfare-bg {
    width: 94%;
    height: 500rpx;
    position: absolute;
    top: 200rpx;
    left: 3%;
  }
  // 每日签到标题
  .sign-title {
    margin-top: 100rpx;
    .sign-title-image {
      width: 260rpx;
      height: 100rpx;
    }
  }

  // 签到容器
  .sign-container {
    display: grid;
    grid-template-columns: repeat(4, 140rpx);
    grid-template-rows: repeat(2, 180rpx);
    gap: 20rpx;
    margin-top: 30rpx;
  }

  // 签到项样式
  .sign-item {
    width: 140rpx;
    height: 180rpx;
    background: url('/static/images/welfare/dayBg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2rpx solid #00ffff;

    .day-number {
      font-size: 24rpx;
      color: #ffffff;
      margin: 10rpx 0;
      font-weight: bold;
    }

    .sign-reward {
      display: flex;
      flex-direction: column;
      align-items: center;

      .crystal-image {
        width: 80rpx;
        height: 80rpx;
      }

      .item-count {
        display: flex;
        align-items: center;

        text {
          font-size: 20rpx;
          font-weight: bold;
          color: #ffffff;
          letter-spacing: 2rpx;
        }
      }
    }
  }

  // 第7天特殊样式
  .sign-item-day7 {
    grid-column: span 2;
    grid-row: span 1;
    width: 310rpx;
    height: 180rpx;
    background: url('/static/images/welfare/day7Bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-direction: row;
    align-items: center;
    .sign-item-content {
      .day-number {
        font-size: 30rpx;
        color: #ffffff;
        font-weight: bold;
        margin-top: 0;
      }
      .item-count {
        display: flex;
        align-items: center;

        text {
          font-size: 25rpx;
          font-weight: bold;
          color: #ffffff;
          letter-spacing: 2rpx;
        }
      }
    }
    .sign-reward {
      flex-direction: row;
      gap: 30rpx;
      align-items: center;

      .crystal-image {
        width: 100rpx;
        height: 100rpx;
      }
    }
  }
}
</style>
